package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the CERTIFICATE database table.
 * 
 */
@Entity
@NamedQuery(name="Certificate.findAll", query="SELECT c FROM Certificate c")
public class Certificate implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="CERTIFICATE_CERTIID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CERTIFICATE_CERTIID_GENERATOR")
	@Column(name="CERTI_ID")
	private long certiId;

	@Column(name="CERTI_BORROWSTATE")
	private String certiBorrowstate;

	@Column(name="CERTI_EFFECTIVEDATE")
	private Timestamp certiEffectivedate;

	@Column(name="CERTI_INTERNALISSUE")
	private BigDecimal certiInternalissue;

	@Column(name="CERTI_NAME")
	private String certiName;

	@Column(name="CERTI_NUMBER")
	private BigDecimal certiNumber;

	@Column(name="CERTI_ORIGINALCOPY")
	private String certiOriginalcopy;

	@Column(name="CERTI_OWNERTYPE")
	private String certiOwnertype;

	@Column(name="CERTI_PERSON")
	private String certiPerson;

	@Column(name="CERTI_RANGEAPPLICATION")
	private String certiRangeapplication;

	@Column(name="CERTI_USESTATE")
	private String certiUsestate;

	//bi-directional many-to-one association to ZszlType
	@ManyToOne
	@JoinColumn(name="ZSZL_ID")
	@JSONField(serialize=false)
	private ZszlType zszlType;

	//bi-directional many-to-one association to CertificateAssist
	@OneToMany(mappedBy="certificate")
	@JSONField(serialize=false)
	private List<CertificateAssist> certificateAssists;

	//bi-directional many-to-one association to CertificateAuxiliary
	@OneToMany(mappedBy="certificate")
	@JSONField(serialize=false)
	private List<CertificateAuxiliary> certificateAuxiliaries;

	//bi-directional many-to-one association to CertificateRegistration
	@OneToMany(mappedBy="certificate")
	@JSONField(serialize=false)
	private List<CertificateRegistration> certificateRegistrations;

	public Certificate() {
	}

	public long getCertiId() {
		return this.certiId;
	}

	public void setCertiId(long certiId) {
		this.certiId = certiId;
	}

	public String getCertiBorrowstate() {
		return this.certiBorrowstate;
	}

	public void setCertiBorrowstate(String certiBorrowstate) {
		this.certiBorrowstate = certiBorrowstate;
	}

	public Timestamp getCertiEffectivedate() {
		return this.certiEffectivedate;
	}

	public void setCertiEffectivedate(Timestamp certiEffectivedate) {
		this.certiEffectivedate = certiEffectivedate;
	}

	public BigDecimal getCertiInternalissue() {
		return this.certiInternalissue;
	}

	public void setCertiInternalissue(BigDecimal certiInternalissue) {
		this.certiInternalissue = certiInternalissue;
	}

	public String getCertiName() {
		return this.certiName;
	}

	public void setCertiName(String certiName) {
		this.certiName = certiName;
	}

	public BigDecimal getCertiNumber() {
		return this.certiNumber;
	}

	public void setCertiNumber(BigDecimal certiNumber) {
		this.certiNumber = certiNumber;
	}

	public String getCertiOriginalcopy() {
		return this.certiOriginalcopy;
	}

	public void setCertiOriginalcopy(String certiOriginalcopy) {
		this.certiOriginalcopy = certiOriginalcopy;
	}

	public String getCertiOwnertype() {
		return this.certiOwnertype;
	}

	public void setCertiOwnertype(String certiOwnertype) {
		this.certiOwnertype = certiOwnertype;
	}

	public String getCertiPerson() {
		return this.certiPerson;
	}

	public void setCertiPerson(String certiPerson) {
		this.certiPerson = certiPerson;
	}

	public String getCertiRangeapplication() {
		return this.certiRangeapplication;
	}

	public void setCertiRangeapplication(String certiRangeapplication) {
		this.certiRangeapplication = certiRangeapplication;
	}

	public String getCertiUsestate() {
		return this.certiUsestate;
	}

	public void setCertiUsestate(String certiUsestate) {
		this.certiUsestate = certiUsestate;
	}

	public ZszlType getZszlType() {
		return this.zszlType;
	}

	public void setZszlType(ZszlType zszlType) {
		this.zszlType = zszlType;
	}

	public List<CertificateAssist> getCertificateAssists() {
		return this.certificateAssists;
	}

	public void setCertificateAssists(List<CertificateAssist> certificateAssists) {
		this.certificateAssists = certificateAssists;
	}

	public CertificateAssist addCertificateAssist(CertificateAssist certificateAssist) {
		getCertificateAssists().add(certificateAssist);
		certificateAssist.setCertificate(this);

		return certificateAssist;
	}

	public CertificateAssist removeCertificateAssist(CertificateAssist certificateAssist) {
		getCertificateAssists().remove(certificateAssist);
		certificateAssist.setCertificate(null);

		return certificateAssist;
	}

	public List<CertificateAuxiliary> getCertificateAuxiliaries() {
		return this.certificateAuxiliaries;
	}

	public void setCertificateAuxiliaries(List<CertificateAuxiliary> certificateAuxiliaries) {
		this.certificateAuxiliaries = certificateAuxiliaries;
	}

	public CertificateAuxiliary addCertificateAuxiliary(CertificateAuxiliary certificateAuxiliary) {
		getCertificateAuxiliaries().add(certificateAuxiliary);
		certificateAuxiliary.setCertificate(this);

		return certificateAuxiliary;
	}

	public CertificateAuxiliary removeCertificateAuxiliary(CertificateAuxiliary certificateAuxiliary) {
		getCertificateAuxiliaries().remove(certificateAuxiliary);
		certificateAuxiliary.setCertificate(null);

		return certificateAuxiliary;
	}

	public List<CertificateRegistration> getCertificateRegistrations() {
		return this.certificateRegistrations;
	}

	public void setCertificateRegistrations(List<CertificateRegistration> certificateRegistrations) {
		this.certificateRegistrations = certificateRegistrations;
	}

	public CertificateRegistration addCertificateRegistration(CertificateRegistration certificateRegistration) {
		getCertificateRegistrations().add(certificateRegistration);
		certificateRegistration.setCertificate(this);

		return certificateRegistration;
	}

	public CertificateRegistration removeCertificateRegistration(CertificateRegistration certificateRegistration) {
		getCertificateRegistrations().remove(certificateRegistration);
		certificateRegistration.setCertificate(null);

		return certificateRegistration;
	}

	@Override
	public String toString() {
		return "Certificate [certiId=" + certiId + ", certiBorrowstate=" + certiBorrowstate + ", certiEffectivedate="
				+ certiEffectivedate + ", certiInternalissue=" + certiInternalissue + ", certiName=" + certiName
				+ ", certiNumber=" + certiNumber + ", certiOriginalcopy=" + certiOriginalcopy + ", certiOwnertype="
				+ certiOwnertype + ", certiPerson=" + certiPerson + ", certiRangeapplication=" + certiRangeapplication
				+ ", certiUsestate=" + certiUsestate + ", zszlType=" + zszlType + ", certificateAssists="
				+ certificateAssists + ", certificateAuxiliaries=" + certificateAuxiliaries
				+ ", certificateRegistrations=" + certificateRegistrations + "]";
	}

}